#include "TestBuffer.h"
#include<stdio.h>

int main()
{
	TestBuffer buffer = TestBuffer();
	printf("Running the test buffer\n");
	
	printf("Running the write test\n");
	unsigned char apple[] = "abcdefghijklmnopqrstuvwxyz";
	printf("the apple string is %s ////\n", apple);
	
	buffer.write((void*) apple, sizeof(apple)/sizeof(unsigned char));
	for(int i = 0; i < sizeof(apple)/sizeof(unsigned char); i++)
		buffer.inToOut();
	void* readValue = buffer.read(sizeof(apple)/sizeof(unsigned char));
	printf("The read string output is %s    ////\n", 
			(unsigned char*) readValue);

	printf("Finished the first test now\n");
	printf("starting the read writebyte tests now\n");
	for(int i = 0; i < sizeof(apple)/sizeof(unsigned char); i++)
		buffer.writeByte(apple[i]);
	for(int i = 0; i < sizeof(apple)/sizeof(unsigned char); i++)
		buffer.inToOut();
	for(int i = 0; i < sizeof(apple)/sizeof(unsigned char); i++)
		printf("%c", buffer.readByte());
	printf("\nFinished read/writeByte test now\n");
	printf("Finished all tests now\n");
	return 0;
}
